package collection.exercise;

import java.util.ArrayList;
import java.util.Iterator;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User:22954
 * Date:2024-02-02
 * Time:1:49
 */
@SuppressWarnings("all")
public class Exercise2 {
    public static void main(String[] args) {
        ArrayList<String> strings = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            strings.add("A"+i);
        }
        strings.add(2,"教育");
        System.out.println(strings.get(4));
        strings.remove(5);
        strings.set(6,"haha");
        System.out.println("==========");
        Iterator<String>iterator=strings.iterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }
    }
}
